Skip to content

Conversation

@barluq
Copy link
Collaborator

@barluq barluq commented Jan 9, 2026

This pull request introduces several improvements and clarifications to the shared TypeScript library, focusing on logging utilities, code helpers, and project documentation. The most important changes include a complete refactor of the logging API for Node.js, new utility functions for working with URLs and timestamps, and the addition of comprehensive coding, build, and testing instructions to the repository. There are also updates to package dependencies and exports for better clarity and usability.

Logging API Refactor:

  • Replaced the old AppLogger class and pretty stream with a set of simple, stateless logging functions (loggyInfo, loggyDebug, loggyWarn, loggyTrace, loggyFatal, loggyAppStart, loggyRequestReceived, loggyResponseSent) in src/node/logging/logger.ts, standardizing logging across the project. These functions are now exported directly from src/index.node.ts instead of the class. [1] [2]

New Utility Functions:

  • Added isUrl and isArrayOfUrls helpers to src/globals/coding/code.formating.ts for validating URLs and arrays of URLs, and exported them in src/index.browser.ts. [1] [2]
  • Introduced nowPlusTime in src/globals/coding/code.dates.ts to get a future/past timestamp by adding seconds, with export in src/index.browser.ts. [1] [2]

Documentation and Coding Guidelines:

  • Added detailed instructions and repository summaries in .github/copilot-instructions.md, AGENTS.md, .github/instructions/build.instructions.md, .github/instructions/coding.instructions.md, and .github/instructions/testing.instructions.md to clarify project structure, coding style, build strategy, and testing practices. [1] [2] [3] [4]

Package and Build Configuration:

  • Updated package.json to clean up peer and dev dependencies, add missing type packages, and ensure typescript-eslint is listed as a dev dependency. Removed unnecessary pino-pretty and @rollup/plugin-commonjs. [1] [2] [3]

ESLint Configuration:

  • Disabled the @typescript-eslint/no-unused-vars rule in eslint.config.mjs for more flexible development.

barluq added 7 commits January 2, 2026 13:29
…ports in index.node.ts; add comprehensive Copilot instructions and build guidelines
- Removed unused peer dependency 'pino-pretty' from peerDependencies.
- Cleaned up devDependencies by removing 'barrelsby' and 'typescript-eslint' duplicate entry.
- Added '@types/luxon' and '@types/node' to devDependencies for better type support.
- Removed the import of '@rollup/plugin-commonjs' from rollup.config.js as it was not being used.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the logging API in the shared TypeScript library, introduces new utility functions for URL validation and timestamp manipulation, and adds comprehensive project documentation. The major focus is on replacing the old AppLogger class with stateless logging functions that directly use pino, removing the dependency on pino-pretty from the codebase.

Key Changes:

  • Complete refactor of the logging API from a class-based approach to functional approach with individual logging functions
  • Addition of URL validation helpers (isUrl, isArrayOfUrls) and timestamp utility (nowPlusTime)
  • Comprehensive project documentation including coding, build, and testing instructions for AI assistants

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/node/logging/logger.ts Replaced AppLogger class with stateless logging functions; refactored to use pino directly without pretty-printing
src/index.node.ts Updated exports to reflect new logging function names
src/index.browser.ts Added exports for new URL and timestamp utility functions
src/globals/coding/code.formating.ts Added isUrl and isArrayOfUrls helper functions for URL validation
src/globals/coding/code.dates.ts Added nowPlusTime function to calculate future/past timestamps
package.json Removed pino-pretty, @rollup/plugin-commonjs, and barrelsby dependencies; reordered dev dependencies
rollup.config.js Removed unused @rollup/plugin-commonjs import
eslint.config.mjs Disabled @typescript-eslint/no-unused-vars rule
AGENTS.md Added comprehensive repository documentation for AI assistants
.github/copilot-instructions.md Added GitHub Copilot-specific instructions (duplicate of AGENTS.md)
.github/instructions/*.md Added detailed coding, testing, and build instructions
package-lock.json Automated dependency updates and removals

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

AGENTS.md Outdated
Shared TypeScript library for backend and frontend applications of the Panther project.

## Important Rule
Read and folow all `.github/instructions/*` files for code and practises clarity.
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "folow" should be "follow".

Copilot uses AI. Check for mistakes.
AGENTS.md Outdated

# Testing and Linting
- Using Vitest as the test framework and typescript for type safety.
- Please folow `.github/instructions/testing.instructions.md` for testing-related guidelines.
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "folow" should be "follow".

Copilot uses AI. Check for mistakes.
Shared TypeScript library for backend and frontend applications of the Panther project.

## Important Rule
Read and folow all `.github/instructions/*` files for code and practises clarity.
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "folow" should be "follow".

Copilot uses AI. Check for mistakes.
applyTo: "src/**/*.ts"
---

# General programming style guidlines for this repository
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "guidlines" should be "guidelines".

Suggested change
# General programming style guidlines for this repository
# General programming style guidelines for this repository

Copilot uses AI. Check for mistakes.
AGENTS.md Outdated
- Functions to parse and validate Arrows.app JSON format (`src/node/api/parse.arrows.json.ts`).
- Utility functions for parsing and validating raw input data (`src/node/api/parse.raw.input.ts`).
- Global types and interfaces shared between frontend and backend (`src/globals/arrows/`, `src/globals/panther/`).
- General shared coding helpers and formaters (`src/globals/coding/`)
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "formaters" should be "formatters".

Suggested change
- General shared coding helpers and formaters (`src/globals/coding/`)
- General shared coding helpers and formatters (`src/globals/coding/`)

Copilot uses AI. Check for mistakes.
- Functions to parse and validate Arrows.app JSON format (`src/node/api/parse.arrows.json.ts`).
- Utility functions for parsing and validating raw input data (`src/node/api/parse.raw.input.ts`).
- Global types and interfaces shared between frontend and backend (`src/globals/arrows/`, `src/globals/panther/`).
- General shared coding helpers and formaters (`src/globals/coding/`)
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "formaters" should be "formatters".

Suggested change
- General shared coding helpers and formaters (`src/globals/coding/`)
- General shared coding helpers and formatters (`src/globals/coding/`)

Copilot uses AI. Check for mistakes.
Comment on lines 32 to 33
export const loggyInfo = (label: string, message: string, options: Record<string, any> = {}): void => {
buildBaseLogger().info({ ...options, label, message })
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new pino logger instance is created on every log call by invoking buildBaseLogger(). This is inefficient and should be avoided. Consider creating the logger once at module scope and reusing it across all logging functions. This will improve performance and reduce memory overhead.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

route: string,
method: string,
options: Record<string, any> = {}) => {
loggyInfo("Request Recived", `${method}: ${route}`, options)
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the label: "Recived" should be "Received".

Suggested change
loggyInfo("Request Recived", `${method}: ${route}`, options)
loggyInfo("Request Received", `${method}: ${route}`, options)

Copilot uses AI. Check for mistakes.

# Testing and Linting
- Using Vitest as the test framework and typescript for type safety.
- Please folow `.github/instructions/testing.instructions.md` for testing-related guidelines.
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "folow" should be "follow".

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI commented Jan 9, 2026

@barluq I've opened a new pull request, #31, to work on those changes. Once the pull request is ready, I'll request review from you.

@barluq barluq merged commit cc4b9d5 into dev Jan 9, 2026
2 checks passed
@barluq barluq deleted the jan25-extended-validation branch January 9, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants